<?php use_stylesheet('bootstrap.min.css') ?>
<?php use_stylesheet('bootstrap-responsive.min.css') ?>
<?php use_javascript('bootstrap.min.js') ?>
<?php include_partial('global/flashes') ?>
<div id="sf_admin_container" class="container-fluid well">
    <div id="sf_admin_content" class="row-fluid">
        <div class="span12">
            <form method="post" action="<?php echo url_for('alumno/inscribirCursado?id=' . $sf_request->getParameter('id')) ?>">
                <div class="sf_admin_form">
                    <?php foreach ($modulos_alumno as $key => $modulos_cuatrimestre): ?>
                        <table class="table table-bordered table-condensed table-striped">
                            <tbody>
                                <tr class="warning">
                                    <td colspan="3"><?php echo $key ?>° Cuatrimestre</td>
                                </tr>
                                <tr class="warning">
                                    <td style="width: 50%;">Unidad Curricular</td>
                                    <td style="width: 30%;">Docente</td>
                                    <td style="width: 20%;">Condición</td>
                                </tr>
                                <?php foreach ($modulos_cuatrimestre as $modulo): ?>
                                    <?php $inscripto = ((int)$modulo['inscripto'] > 0) ?>
                                    <tr <?php echo $inscripto ? 'class="success"' : '' ?>>
                                        <td><?php echo $modulo['modulo'] . ($modulo['regimen'] == 'Anual' ? ' (Anual)' : '') ?></td>
                                        <td><?php echo $modulo['apellido'] . ', ' . $modulo['nombre'] ?></td>
                                        <td>
                                            <select class="condensed" name="modulo[<?php echo $modulo['id'] ?>][condicion]" id="modulo_<?php echo $modulo['id'] ?>_condicion">
                                                <?php
                                                echo '<option value="0" '.(!$inscripto ? 'selected' : '').'>No Se Inscribe</option>';
                                                foreach ($condiciones_cursado as $condicion_cursado) {
                                                    echo '<option '.($condicion_cursado->getNombre() == $modulo['condicion'] ? 'selected' : '').' value="' . $condicion_cursado->getId() . '">' . $condicion_cursado->getNombre() . '</option>';
                                                }
                                                ?>
                                            </select>
                                        </td>
                                    </tr>
                                <?php endforeach ?>
                            </tbody>
                        </table>
                    <?php endforeach; ?>
                    <input type="submit" class="btn btn-large btn-warning pull-right" value="Guardar" />
                    <div class="clearfix"></div>
                </div>
            </form>
        </div>
    </div>
</div>